#ifndef EULER_HPP
#define EULER_HPP

#include "points.hpp"

#define EPSILON 0.0005
#define DAMPING 5

class Cabs_integr {
    uint size, wsize;
    point* P;
    wire* W;
public:
    Cabs_integr(point* p = NULL, uint s = 0, wire* w = NULL, uint ws = 0);

	// setter-getters
    uint& getsize();
    uint& getwsize();
    wire& getwire(uint& nr);
    point& getpoint(uint& nr);
    void setptrs(point* p, wire* w);

	// common methods and also less setting-getting
	void prepare_force();
	void eval_derr(float, point&);

	// for checking
    void printp(const point& pt, bool f = 0);
};

class CEuler: public Cabs_integr {
	// time
    float t;
public:
	CEuler(point* p = NULL, uint s = 0, wire* w = NULL, uint ws = 0);
	void solve(float h, float endt);
};

class CRK4: public Cabs_integr {
	// final - final derivative; store - unchanging value in cycle
    vec* final_pos;
    vec* final_vel;
    vec* store_pos;
    vec* store_vel;
    float t;
	public:
		CRK4(point* p = NULL, uint s = 0, wire* w = NULL, uint ws = 0);
		~CRK4();
		void solve(float h, float endt);
};

#endif
